package com.brainhealth.customer.service.impl;

import java.util.List;
import com.brainhealth.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.brainhealth.customer.mapper.ExerciseCategoryMapper;
import com.brainhealth.customer.domain.ExerciseCategory;
import com.brainhealth.customer.service.IExerciseCategoryService;

/**
 * 训练产品项目分类Service业务层处理
 * 
 * @author wolong
 * @date 2023-07-11
 */
@Service
public class ExerciseCategoryServiceImpl implements IExerciseCategoryService 
{
    @Autowired
    private ExerciseCategoryMapper exerciseCategoryMapper;

    /**
     * 查询训练产品项目分类
     * 
     * @param exerciseCategoryId 训练产品项目分类主键
     * @return 训练产品项目分类
     */
    @Override
    public ExerciseCategory selectExerciseCategoryByExerciseCategoryId(Long exerciseCategoryId)
    {
        return exerciseCategoryMapper.selectExerciseCategoryByExerciseCategoryId(exerciseCategoryId);
    }

    /**
     * 查询训练产品项目分类列表
     * 
     * @param exerciseCategory 训练产品项目分类
     * @return 训练产品项目分类
     */
    @Override
    public List<ExerciseCategory> selectExerciseCategoryList(ExerciseCategory exerciseCategory)
    {
        return exerciseCategoryMapper.selectExerciseCategoryList(exerciseCategory);
    }

    /**
     * 新增训练产品项目分类
     * 
     * @param exerciseCategory 训练产品项目分类
     * @return 结果
     */
    @Override
    public int insertExerciseCategory(ExerciseCategory exerciseCategory)
    {
        exerciseCategory.setCreateTime(DateUtils.getNowDate());
        return exerciseCategoryMapper.insertExerciseCategory(exerciseCategory);
    }

    /**
     * 修改训练产品项目分类
     * 
     * @param exerciseCategory 训练产品项目分类
     * @return 结果
     */
    @Override
    public int updateExerciseCategory(ExerciseCategory exerciseCategory)
    {
        exerciseCategory.setUpdateTime(DateUtils.getNowDate());
        return exerciseCategoryMapper.updateExerciseCategory(exerciseCategory);
    }

    /**
     * 批量删除训练产品项目分类
     * 
     * @param exerciseCategoryIds 需要删除的训练产品项目分类主键
     * @return 结果
     */
    @Override
    public int deleteExerciseCategoryByExerciseCategoryIds(Long[] exerciseCategoryIds)
    {
        return exerciseCategoryMapper.deleteExerciseCategoryByExerciseCategoryIds(exerciseCategoryIds);
    }

    /**
     * 删除训练产品项目分类信息
     * 
     * @param exerciseCategoryId 训练产品项目分类主键
     * @return 结果
     */
    @Override
    public int deleteExerciseCategoryByExerciseCategoryId(Long exerciseCategoryId)
    {
        return exerciseCategoryMapper.deleteExerciseCategoryByExerciseCategoryId(exerciseCategoryId);
    }
}
